home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 6 / Amoszine 6 (Disk 2 of 2).adf / extra_source.lha / OTHER_SOURCE / REF_ASCII.Amos / REF_ASCII.amosSourceCode
Encoding:
AMOS Source Code  |  1992-02-26  |  468 b   |  15 lines

  1. Procedure REF_ASCII[N]
  2.  'UPDATED V1_f_37 
  3.  '* CONVERTS THE NUMBER N into A 3 DIGIT CHARACTER REPRESENTATION   
  4.  '* can handle > 16 million w/o looping around
  5.  '
  6.  'Updated by Andy Church: accept a number instead of a string, and fix
  7.  '  MOD statement below (used to be "mod 16581374", which cut off the 
  8.  '  highest value). 
  9.  '
  10.  R=(N mod 16581375)
  11.  R1=R/65025 : R=R-(R1*65025)
  12.  R2=R/255 : R=R-(R2*255)
  13.  Inc R1 : Inc R2 : Inc R
  14.  R$=Chr$(R1)+Chr$(R2)+Chr$(R)
  15. End Proc[R$]